export function showToast(title, icon = 'none', duration = 1000, mask = true) {
	uni.showToast({
		title: title,
		icon: icon,
		duration: duration,
		mask: mask,
	});
}

export function showLoading(title, mask = true) {
	uni.showLoading({
		title: title,
		mask: mask,
	});
}

export function hideLoading() {
	uni.hideLoading();
}

export function showModal(title, content, showCancel = true, confirmText = '确认', cancelText = '取消', success, cancel) {
	uni.showModal({
		title: title,
		content: content,
		showCancel: showCancel,
		confirmText: confirmText,
		cancelText: cancelText,
		success: (res) => {
			if (res.confirm) {
				success()
			} else
			if (res.cancel) {
				cancel()
			}
		}
	});
}